import Login from '@/views/login/index.vue'
import Layout from '@/layout/index.vue'

const routes = [
    {
        path: '/',
        component: Layout,
        alwayShow: true,
        meta: { icon: 'icon-caidan', title: '页面' },
        redirect: '/home',
        children: [
            { path: '/home', name: 'home', component: () => import('@/views/home/index.vue'), meta: { title: '首页', cache: true } },
            { path: '/secretCustomer', name: 'secretCustomer', component: () => import('@/views/secretCustomer/index.vue'), meta: { title: '神客管理', cache: true } },
            { path: '/emp', name: 'emp', component: () => import('@/views/emp/emp.vue'), meta: { title: '员工', cache: false } },
            { path: '/cardList', name: 'cardList', component: () => import('@/views/cards/index.vue'), meta: { title: '卡片列表' } }
        ]
    },
    { path: '/login', name: 'login', hideMenu: true, component: Login },
    {
        path: '/system',
        component: Layout,
        redirect: '/404',
        hideMenu: true,
        meta: { title: '系统目录' },
        children: [
            {
                path: '/404',
                component: () => import('@/views/system/404.vue'),
                name: 'page404',
                meta: { title: '404', hideTabs: true }
            },
            {
                path: '/401',
                component: () => import('@/views/system/401.vue'),
                name: 'page401',
                meta: { title: '401', hideTabs: true }
            },
            {
                path: '/redirect/:path(.*)',
                component: () => import('@/views/system/redirect.vue'),
                name: 'redirect_page',
                meta: { title: '重定向页面', hideTabs: true }
            }
        ]
    },
    {
        // 找不到路由重定向到404页面
        path: '/:pathMatch(.*)',
        component: Layout,
        redirect: '/404',
        hideMenu: true,
        meta: { title: '' }
    }
]

export default routes
